/*
 * @Author: 李泽琛
 * @Date: 2021-06-08 11:36:06
 * @LastEditTime: 2021-06-08 14:28:00
 * @Description:
 */
const ADODB = require("node-adodb");
/**
 * @author: 李泽琛
 * @Date: 2021-06-08 14:27:57
 * @description:
 * @param {*} sql
 * @param {*} source
 */
async function query(sql, source = 1) {
  const connection = ADODB.open(`Provider=Microsoft.ACE.OLEDB.15.0;Data Source=E:\\Project_back\\航图大师\\flight_node_access\\dataSource\\Database${source}.accdb;Persist Security Info=False;`);

  try {
    const result = await connection.query(sql);
    return result;
  } catch (error) {
    console.error(error);
  }
}

module.exports = { query };
